home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Programming / MUI / MCC_VLab / Developer / autodocs / VLab.autodoc next >
Encoding:
Text File  |  1999-05-18  |  15.2 KB  |  627 lines

  1. TABLE OF CONTENTS
  2.  
  3. VLab.mcc/--background--
  4. VLab.mcc/MUIA_VLab_Height
  5. VLab.mcc/MUIA_VLab_Left
  6. VLab.mcc/MUIA_VLab_Monitor
  7. VLab.mcc/MUIA_VLab_MonitorObject
  8. VLab.mcc/MUIA_VLab_Top
  9. VLab.mcc/MUIA_VLab_Width
  10. VLab.mcc/MUIM_VLab_AllocRGBBuffer
  11. VLab.mcc/MUIM_VLab_AllocYUVBuffer
  12. VLab.mcc/MUIM_VLab_DeInterlace
  13. VLab.mcc/MUIM_VLab_FindHardware
  14. VLab.mcc/MUIM_VLab_FreeRGBBuffer
  15. VLab.mcc/MUIM_VLab_FreeYUVBuffer
  16. VLab.mcc/MUIM_VLab_Grab
  17. VLab.mcc/MUIM_VLab_MonitorOff
  18. VLab.mcc/MUIM_VLab_MonitorOn
  19. VLab.mcc/MUIM_VLab_YUVtoRGB
  20. VLab.mcc/--background--                               VLab.mcc/--background--
  21.  
  22.    PURPOSE
  23.  To grab images from a VLab card.
  24.  
  25.  Features:
  26.  Grabbing of images from a VLab card.
  27.  The option of buffering images on disk (VMem) or in memory.
  28.  YUV to RGB conversion
  29.  
  30.    THANKYOUS
  31.  Many thanks to
  32.    Paul Huxham
  33.      - For his expertise and incredible knowledge of the Amiga platform.
  34.  
  35.    Frank Mariak
  36.      - For his modified vlab.library and help with the monitor.
  37.  
  38.    Stefan Stuntz
  39.      - For MUI!
  40.  
  41.    Debra Quartly
  42.      - For her love and patience.
  43.  
  44.    AUTHOR
  45.   You can contact the author via:
  46.     email: steveq@mafeking.scouts.org.au
  47.   or
  48.    1280 Stevens St
  49.    Mundaring,
  50.     Western Australia 6073
  51.  
  52. VLab.mcc/MUIA_VLab_Height                           VLab.mcc/MUIA_VLab_Height
  53.  
  54.    NAME
  55.  MUIA_VLab_Height --  [..G], LONG
  56.  
  57.    FUNCTION
  58.  You can use this to read the current height in the settings.
  59.  This is used by the grab function
  60.  
  61.    BUGS
  62.  None known.
  63.  
  64.    SEE ALSO
  65.  MUIA_VLab_Top, MUIA_VLab_Left, MUIA_VLab_Width
  66. VLab.mcc/MUIA_VLab_Left                               VLab.mcc/MUIA_VLab_Left
  67.  
  68.    NAME
  69.  MUIA_VLab_Left --  [..G], LONG
  70.  
  71.    FUNCTION
  72.  You can use this to read the current left position in the settings.
  73.  This is used by the grab function
  74.  
  75.    BUGS
  76.  None known.
  77.  
  78.    SEE ALSO
  79.  MUIA_VLab_Top, MUIA_VLab_Width, MUIA_VLab_Height
  80. VLab.mcc/MUIA_VLab_Monitor                         VLab.mcc/MUIA_VLab_Monitor
  81.  
  82.    NAME
  83.  MUIA_VLab_Monitor --  [.S.], LONG.
  84.  
  85.    FUNCTION
  86.  This is used to run or stop the monitor while it is active.
  87.  Handy to reduce CPU usage while doing CPU intensive work.
  88.  
  89.  Use either of the 2 special values:
  90.    MUIV_VLab_MonitorRun
  91.    MUIV_VLab_MonitorStop
  92.  
  93.  If you have turned on the monitor with MUIM_VLab_MonitorOn then
  94.  you just pass this tag and value to your VLabObject.
  95.  
  96.  EG:
  97.  {
  98.    Object *vlabObj;
  99.  
  100.    vlabObj = VLabObject, End;
  101.  
  102.    if( vlabObj )
  103.    {
  104.      DoMethod( app, OM_ADDMEMBER, vlabObj );
  105.  
  106.      /* Open a window with a monitor.*/
  107.      DoMethod( vlabObj, MUIM_VLab_MonitorOn );
  108.  
  109.      set( vlabObj, MUIA_VLab_Monitor, MUIV_VLab_MonitorStop );
  110.    }
  111.  }
  112.  
  113.  If you have turned on the monitor with MUIA_VLab_MonitorObject
  114.  and have attached it to your own window, then you just pass this
  115.  tag and value to the object that was returned by the
  116.  MUIA_VLab_MonitorObject call.
  117.  
  118.  EG:
  119.  {
  120.    Object *vlabObj, *vlabMonitor, *vlabWindow;
  121.  
  122.    vlabObj = VLabObject, End;
  123.  
  124.    if( vlabObj )
  125.    {
  126.      DoMethod( app, OM_ADDMEMBER, vlabObj );
  127.  
  128.      get( vlabObj, MUIA_VLab_MonitorObject, &vlabMonitor );
  129.  
  130.      if ( vlabMonitor )
  131.      {
  132.        vlabWindow = WindowObject,
  133.          MUIA_Window_Title, "VLab Monitor",
  134.          MUIA_Window_ID, MAKE_ID('V','L','A','B'),
  135.          WindowContents, VGroup,
  136.            Child, vlabMonitor,
  137.          End,
  138.        End;
  139.  
  140.        if ( vlabWindow )
  141.        {
  142.          DoMethod( app, OM_ADDMEMBER, vlabWindow );
  143.  
  144.          /* Stop (pause) the monitor.*/
  145.          set( vlabMonitor, MUIA_VLab_Monitor, MUIV_VLab_MonitorStop );
  146.        }
  147.      }
  148.    }
  149.  }
  150.  
  151.  
  152.    BUGS
  153.  None known.
  154.  
  155.    SEE ALSO
  156.  MUIM_VLab_MonitorOn, MUIM_VLab_MonitorOff
  157. VLab.mcc/MUIA_VLab_MonitorObject             VLab.mcc/MUIA_VLab_MonitorObject
  158.  
  159.    NAME
  160.  MUIA_VLab_MonitorObject --  [..G], Object *
  161.  
  162.    FUNCTION
  163.  This will return a pointer to a monitor object. This monitor object can
  164.  then be attached to a window, which will then display a monitor. The
  165.  advantage of this over MUIM_VLab_MonitorOn is that it will open in the
  166.  window of your choice, rather than a separate window. The object pointer
  167.  then belongs to you. It is your responsibility to dispose of it when you
  168.  are finished with it.
  169.  
  170.  It is worthwhile noting that the monitor is not terribly practical when it
  171.  comes to making grabs. By the time you see the frame on the monitor, it has
  172.  already gone, therefore the frame you grab will not be the one you see.
  173.  
  174.  EG:
  175.  {
  176.    Object *vlabObj, *vlabMonitor, *vlabWindow;
  177.  
  178.    vlabObj = VLabObject, End;
  179.  
  180.    if( vlabObj )
  181.    {
  182.      DoMethod( app, OM_ADDMEMBER, vlabObj );
  183.  
  184.      get( vlabObj, MUIA_VLab_MonitorObject, &vlabMonitor );
  185.  
  186.      if ( vlabMonitor )
  187.      {
  188.        vlabWindow = WindowObject,
  189.          MUIA_Window_Title, "VLab Monitor",
  190.          MUIA_Window_ID, MAKE_ID('V','L','A','B'),
  191.          WindowContents, VGroup,
  192.            Child, vlabMonitor,
  193.          End,
  194.        End;
  195.  
  196.        if ( vlabWindow )
  197.        {
  198.          DoMethod( app, OM_ADDMEMBER, vlabWindow );
  199.  
  200.          /* The monitor is now running in your window.*/
  201.        }
  202.      }
  203.    }
  204.  }
  205.  
  206.    BUGS
  207.  None known.
  208.  
  209.    SEE ALSO
  210.  MUIM_VLab_MonitorOn, MUIM_VLab_MonitorOff
  211. VLab.mcc/MUIA_VLab_Top                                 VLab.mcc/MUIA_VLab_Top
  212.  
  213.    NAME
  214.  MUIA_VLab_Top --  [..G], LONG
  215.  
  216.    FUNCTION
  217.  You can use this to read the current top position in the settings.
  218.  This is used by the grab function
  219.  
  220.    BUGS
  221.  None known.
  222.  
  223.    SEE ALSO
  224.  MUIA_VLab_Left, MUIA_VLab_Width, MUIA_VLab_Height
  225. VLab.mcc/MUIA_VLab_Width                             VLab.mcc/MUIA_VLab_Width
  226.  
  227.    NAME
  228.  MUIA_VLab_Width --  [..G], LONG
  229.  
  230.    FUNCTION
  231.  You can use this to read the current width in the settings.
  232.  This is used by the grab function
  233.  
  234.    BUGS
  235.  None known.
  236.  
  237.    SEE ALSO
  238.  MUIA_VLab_Top, MUIA_VLab_Left, MUIA_VLab_Height
  239. VLab.mcc/MUIM_VLab_AllocRGBBuffer           VLab.mcc/MUIM_VLab_AllocRGBBuffer
  240.  
  241.    NAME
  242.  MUIM_VLab_AllocRGBBuffer -- Allocate enough memory to store a RGB image.
  243.  
  244.    SYNOPSIS
  245.  result = DoMethod( obj, MUIM_VLab_AllocRGBBuffer, &rgb )
  246.  
  247.  ULONG DoMethod( Object *obj, MUIM_VLab_AllocRGBBuffer, UBYTE **rgb )
  248.  
  249.    FUNCTION
  250.  This method will return a pointer to enough memory to store a grabbed image.
  251.  that needs to be converted to RGB.
  252.  You will probably never need this function, as VLabImage.mcc does this
  253.  internally.
  254.  It is included for the sake of completeness.
  255.  
  256.  EG:
  257.  {
  258.    Object *vlabObj;
  259.    LONG *rgb, width, height;
  260.  
  261.    vlabObj = VLabObject, End;
  262.  
  263.    if( vlabObj )
  264.    {
  265.      DoMethod( app, OM_ADDMEMBER, vlabObj );
  266.  
  267.      get( vlabObj, MUIA_VLab_Width, &width );
  268.      get( vlabObj, MUIA_VLab_Height, &height );
  269.  
  270.      if ( DoMethod( vlabObj, MUIM_VLab_AllocRGBBuffer, &rgb, width,
  271.                     height ) == VLABERR_OK )
  272.      {
  273.        /* Buffer alloc'ed ok!*/
  274.      }
  275.    }
  276.  }
  277.  
  278.  
  279.    INPUTS
  280.  rgb - Pointer to a where to store the rgb pointer.
  281.  
  282.    RESULT
  283.  VLABERR_OK - if successful
  284.   An error code if unsuccessful.
  285.  See vlab_mcc.h for possible error codes.
  286.  
  287.    WARNING
  288.  A call to MUIM_VLab_FreeRGBBuffer must be made when you have finished with
  289.  the buffer. 
  290.  
  291.    BUGS
  292.  None known.
  293.  
  294.    SEE ALSO
  295.  MUIM_VLab_FreeYUVBuffer, MUIM_VLab_AllocYUVBuffer, MUIM_VLab_FreeRGBBuffer
  296. VLab.mcc/MUIM_VLab_AllocYUVBuffer           VLab.mcc/MUIM_VLab_AllocYUVBuffer
  297.  
  298.    NAME
  299.  MUIM_VLab_AllocYUVBuffer -- Allocate enough memory to store a YUV image.
  300.  
  301.    SYNOPSIS
  302.  result = DoMethod( obj, MUIM_VLab_AllocYUVBuffer, &y, &u, &v )
  303.  
  304.  ULONG DoMethod( Object *obj, MUIM_VLab_AllocYUVBuffer, ULONG **y,
  305.                  ULONG **u, ULONG **v )
  306.  
  307.    FUNCTION
  308.  This method will return pointers (y,u,v) to enough memory to store a grabbed
  309.  image. You will probably never need this function, as MUIM_VLab_Grab does
  310.  this internally before a grab.
  311.  It is included for the sake of completeness.
  312.  
  313.  EG:
  314.  {
  315.    Object *vlabObj;
  316.    LONG *y, *u, *v, width, height;
  317.  
  318.    vlabObj = VLabObject, End;
  319.  
  320.    if( vlabObj )
  321.    {
  322.      DoMethod( app, OM_ADDMEMBER, vlabObj );
  323.  
  324.      get( vlabObj, MUIA_VLab_Width, &width );
  325.      get( vlabObj, MUIA_VLab_Height, &height );
  326.  
  327.      if ( DoMethod( vlabObj, MUIM_VLab_AllocYUVBuffer, &y, &u, &v, width,
  328.                     height ) == VLABERR_OK )
  329.      {
  330.        /* Buffer alloc'ed ok!*/
  331.      }
  332.    }
  333.  }
  334.  
  335.    INPUTS
  336.  y - Pointer to a where to store the y pointer.
  337.  u - Pointer to a where to store the u pointer.
  338.  v - Pointer to a where to store the v pointer.
  339.  
  340.    RESULT
  341.  VLABERR_OK - if successful
  342.   An error code if unsuccessful.
  343.  See vlab_mcc.h for possible error codes.
  344.  
  345.    WARNING
  346.  A call to MUIM_VLab_FreeYUVBuffer must be made when you have finished with
  347.  the buffer. 
  348.  
  349.    BUGS
  350.  None known.
  351.  
  352.    SEE ALSO
  353.  MUIM_VLab_FreeYUVBuffer, MUIM_VLab_AllocRGBBuffer, MUIM_VLab_FreeRGBBuffer
  354. VLab.mcc/MUIM_VLab_DeInterlace                 VLab.mcc/MUIM_VLab_DeInterlace
  355.  
  356.    NAME
  357.  MUIM_VLab_DeInterlace -- DeInterlace a RGB buffer.
  358.  
  359.    SYNOPSIS
  360.  result = DoMethod( obj, MUIM_VLab_DeInterlace, rgb, width, height,
  361.                     modulo, pixinc, mode )
  362.  
  363.  ULONG DoMethod( Object *obj, MUIM_VLab_DeInterlace, UBYTE *rgb, LONG width,
  364.                  LONG height, LONG modulo, LONG pixinc, LONG mode )
  365.  
  366.    FUNCTION
  367.  Digitized full frame images often have big differences between their
  368.  two half frames caused by quickly moving objects. This function
  369.  removes such effects by reducing the vertical resolution at these
  370.  locations (and only there).
  371.  
  372.    INPUTS
  373.  rgb - Pointer to a rgb buffer.
  374.  width - The width of the image.
  375.  height - The height ot the image.
  376.  modulo - The number of bytes to add to go exactly one line down.
  377.  pixInc - The number of bytes to add to go to the next pixel.
  378.  mode   - Mode must be one of these:
  379.           DIM_EVEN - Use the even frame to reduce flickering.
  380.                      DIM_EVEN provides the best results and
  381.                      should be used as a default.
  382.           DIM_ODD  - Use the odd frame to reduce flickering.
  383.           DIM_MIX  - Mix both frames.
  384.           DIM_SET  - Set pixel to 255 for demonstration or debugging.
  385.  
  386.    RESULT
  387.  VLABERR_OK - if successful
  388.  An error code if unsuccessful.
  389.  See vlab_mcc.h for possible error codes.
  390.  
  391.    WARNING
  392.  Do not Deinterlace any buffer returned to you by
  393.  MUIM_VLabImage_ObtainRGBPointer, copy it first and Deinterlace the copy.
  394.  
  395.    BUGS
  396.  
  397.    SEE ALSO
  398.  
  399. VLab.mcc/MUIM_VLab_FindHardware               VLab.mcc/MUIM_VLab_FindHardware
  400.  
  401.    NAME
  402.  MUIM_VLab_FindHardware -- Look for a VLab card
  403.  
  404.    SYNOPSIS
  405.  result = DoMethod( obj, MUIM_VLab_FindHardware )
  406.  
  407.  ULONG DoMethod( Object *obj, MUIM_VLab_FindHardware )
  408.  
  409.    FUNCTION
  410.  This method merely tests to see if input 1 is available, if it is not
  411.  then it is assumed that no VLab card is plugged in.
  412.  
  413.    INPUTS
  414.  
  415.    RESULT
  416.  TRUE - if input 1 is found.
  417.  FALSE - if input 1 is not found.
  418.  
  419.    WARNING
  420.  
  421.    BUGS
  422.  None known.
  423.  
  424.    SEE ALSO
  425.  
  426. VLab.mcc/MUIM_VLab_FreeRGBBuffer             VLab.mcc/MUIM_VLab_FreeRGBBuffer
  427.  
  428.    NAME
  429.  MUIM_VLab_FreeRGBBuffer -- Free a previously allocated RGB buffer.
  430.  
  431.    SYNOPSIS
  432.  result = DoMethod( obj, MUIM_VLab_FreeRGBBuffer, rgb )
  433.  
  434.  ULONG DoMethod( Object *obj, MUIM_VLab_FreeRGBBuffer, UBYTE *rgb )
  435.  
  436.    FUNCTION
  437.  This method will frees a previously allocated rgb pointer.
  438.  
  439.    INPUTS
  440.  rgb - Pointer to the buffer.
  441.  
  442.    RESULT
  443.  
  444.    WARNING
  445.  
  446.    BUGS
  447.  None known.
  448.  
  449.    SEE ALSO
  450.  MUIM_VLab_AllocYUVBuffer, MUIM_VLab_AllocRGBBuffer, MUIM_VLab_FreeYUVBuffer
  451. VLab.mcc/MUIM_VLab_FreeYUVBuffer             VLab.mcc/MUIM_VLab_FreeYUVBuffer
  452.  
  453.    NAME
  454.  MUIM_VLab_FreeYUVBuffer -- Free a previously allocated YUV buffer.
  455.  
  456.    SYNOPSIS
  457.  result = DoMethod( obj, MUIM_VLab_FreeYUVBuffer, y, u, v )
  458.  
  459.  ULONG DoMethod( Object *obj, MUIM_VLab_FreeYUVBuffer, ULONG *y, ULONG *u,
  460.                  ULONG *v )
  461.  
  462.    FUNCTION
  463.  This method will frees previously allocated y,u,v pointers.
  464.  
  465.    INPUTS
  466.  y - Pointer to the y buffer.
  467.  u - Pointer to the u buffer.
  468.  v - Pointer to the v buffer.
  469.  
  470.    RESULT
  471.  
  472.    WARNING
  473.  
  474.    BUGS
  475.  None known.
  476.  
  477.    SEE ALSO
  478.  MUIM_VLab_AllocYUVBuffer, MUIM_VLab_AllocRGBBuffer, MUIM_VLab_FreeRGBBuffer
  479. VLab.mcc/MUIM_VLab_Grab                               VLab.mcc/MUIM_VLab_Grab
  480.  
  481.    NAME
  482.  MUIM_VLab_Grab -- Grab a frame from the VLab card
  483.  
  484.    SYNOPSIS
  485.  result = DoMethod( obj, MUIM_VLab_Grab, &vlabImage )
  486.  
  487.  ULONG DoMethod( Object *obj, MUIM_VLab_Grab, Object **vlabImage )
  488.  
  489.    FUNCTION
  490.  Calling this method will grab a frame from the input of the VLab card.
  491.  If the grab was successful then vlabImage will point to a vlabImage object.
  492.  If the grab was unsuccessful then vlabImage will be NULL.
  493.  
  494.  EG:
  495.  {
  496.    Object *vlabObj, *vlabImage;
  497.  
  498.    ULONG result;
  499.  
  500.    vlabObj = VLabObject, End;
  501.  
  502.    if( vlabObj )
  503.    {
  504.      DoMethod( app, OM_ADDMEMBER, vlabObj );
  505.  
  506.      result = DoMethod( vlabObj, MUIM_VLab_Grab, &vlabImage );
  507.  
  508.      if ( result == VLABERR_OK )
  509.      {
  510.       /* Grab successful!!! vlabImage has an object pointer to it.*/
  511.       /* Simply attach it to a window! See the demo code.*/
  512.      }
  513.    }
  514.  }
  515.  
  516.    INPUTS
  517.  
  518.    RESULT
  519.  VLABERR_OK - if successful
  520.   An error code if unsuccessful.
  521.  See vlab_mcc.h for possible error codes.
  522.  
  523.    WARNING
  524.  
  525.    BUGS
  526.  None known.
  527.  
  528.    SEE ALSO
  529.  
  530. VLab.mcc/MUIM_VLab_MonitorOff                   VLab.mcc/MUIM_VLab_MonitorOff
  531.  
  532.    NAME
  533.  MUIM_VLab_MonitorOff -- Close the monitor window.
  534.  
  535.    SYNOPSIS
  536.  result = DoMethod( obj, MUIM_VLab_MonitorOff )
  537.  
  538.  ULONG DoMethod( Object *obj, MUIM_VLab_MonitorOff )
  539.  
  540.    FUNCTION
  541.  This method will close a previously open monitor window.
  542.  
  543.    INPUTS
  544.  
  545.    RESULT
  546.  
  547.    WARNING
  548.  If MUIA_VLab_MonitorObject was used to open the monitor window, this method
  549.  SHOULD NOT be used to close it.
  550.  
  551.    BUGS
  552.  None known.
  553.  
  554.    SEE ALSO
  555.  MUIM_VLab_MonitorOn, MUIA_VLab_MonitorObject
  556. VLab.mcc/MUIM_VLab_MonitorOn                     VLab.mcc/MUIM_VLab_MonitorOn
  557.  
  558.    NAME
  559.  MUIM_VLab_MonitorOn -- Open a window and display a grayscale monitor in it.
  560.  
  561.    SYNOPSIS
  562.  result = DoMethod( obj, MUIM_VLab_MonitorOn )
  563.  
  564.  ULONG DoMethod( Object *obj, MUIM_VLab_MonitorOn )
  565.  
  566.    FUNCTION
  567.  This method will open a window, then add a grayscale monitor to it. Below
  568.  the monitor is a status line. The size of the monitor is set and cannot be
  569.  changed. If the monitor window is already open, calling this method will
  570.  activate and bring the window to the front.
  571.  
  572.  It is worthwhile noting that the monitor is not terribly practical when it
  573.  comes to making grabs. By the time you see the frame on the monitor, it has
  574.  already gone, therefore the frame you grab will not be the one you see.
  575.  
  576.    INPUTS
  577.  
  578.    RESULT
  579.  VLABERR_OK - if successful
  580.  FALSE - if for some reason the window creation failed.
  581.  
  582.    WARNING
  583.  For this method to work, the VLab Object must be added to the application
  584.  prior to this call.
  585.  
  586.    BUGS
  587.  None known.
  588.  
  589.    SEE ALSO
  590.  MUIM_VLab_MonitorOff, MUIA_VLab_MonitorObject
  591. VLab.mcc/MUIM_VLab_YUVtoRGB                       VLab.mcc/MUIM_VLab_YUVtoRGB
  592.  
  593.    NAME
  594.  MUIM_VLab_YUVtoRGB -- Convert a YUV buffer to RGB
  595.  
  596.    SYNOPSIS
  597.  result = DoMethod( obj, MUIM_VLab_YUVtoRGB, y, u, v, rgb, width, height )
  598.  
  599.  ULONG DoMethod( Object *obj, MUIM_VLab_YUVtoRGB, ULONG *y, ULONG *u,
  600.                  ULONG *v, UBYTE *rgb, LONG width, LONG height )
  601.  
  602.    FUNCTION
  603.  This method converts a grabbed YUV image and converts it to RGB. 
  604.  Pointers to y,u,v and rgb buffers must be supplied.
  605.  See MUIM_VLab_AllocYUVBuffer, MUIM_VLab_AllocRGBBuffer. Normally
  606.  you won't need to call this function as VLabImage.mcc handles this
  607.  internally.
  608.  It is included for the sake of completeness.
  609.  
  610.    INPUTS
  611.  y - Pointer to a previously allocated y buffer.
  612.  u - Pointer to a previously allocated u buffer.
  613.  v - Pointer to a previously allocated v buffer.
  614.  rgb - Pointer to a previously allocated rgb buffer.
  615.  width - The width of the image.
  616.  height - The height ot the image.
  617.  
  618.    RESULT
  619.  
  620.    WARNING
  621.  
  622.    BUGS
  623.  None known.
  624.  
  625.    SEE ALSO
  626.  
  627.